//
//  QueRenZhiFuViewController.m
//  EJLX
//
//  Created by adc on 15/11/26.
//  Copyright © 2015年 江苏一键联信息科技有限公司. All rights reserved.
//

#import "QueRenZhiFuViewController.h"
#import "QueRenZhiFuTableViewCell.h"
#import "YiBaoZhiFuViewController.h"
@interface QueRenZhiFuViewController ()

@end

@implementation QueRenZhiFuViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIView*view=[[UIView alloc]initWithFrame:CGRectMake(0,20,WIDE, 44)];
    view.backgroundColor=RGB_COLOR(0x00c49f);
    [self.view addSubview:view];
    UIButton*backBut=[[UIButton alloc]initWithFrame:CGRectMake(10,5, 20, 34)];
    [backBut setImage:[UIImage imageNamed:@"返回箭头"] forState:UIControlStateNormal];
    [backBut addTarget:self action:@selector(butClick) forControlEvents:UIControlEventTouchUpInside];
    [view addSubview:backBut];
    UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(WIDE/2-50, 10,100, 24)];
    label.text=@"确认支付";
    label.textColor=[UIColor whiteColor];
    [view addSubview:label];
    UITableView*tableView=[[UITableView alloc]initWithFrame:CGRectMake(0,74, WIDE,300) style:UITableViewStylePlain];
    tableView.delegate=self;
    tableView.dataSource=self;
    tableView.rowHeight=60;
    [self.view addSubview:tableView];
    [tableView registerNib:[UINib nibWithNibName:@"QueRenZhiFuTableViewCell" bundle:nil] forCellReuseIdentifier:@"cell"];
    
    // Do any additional setup after loading the view, typically from a nib.
}
//-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
//{
//    return 3;
//}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    //    if (section==0)
    //    {
    //        return 2;
    //    }
    //    if (section==1)
    //    {
    //        return 2;
    //    }
    return 5;
}
//-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
//{
//    return 20;
//}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSArray*ary=[NSArray arrayWithObjects:@"易宝支付",@"京东支付",@"支付宝支付",@"蓝牙刷卡器",@"微信支付",nil];
    QueRenZhiFuTableViewCell*cell=[tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    //    if (indexPath.section==0)
    //    {
    //        NSArray*ary=[NSArray arrayWithObjects:@"易宝支付T+1",@"易宝支付T+0", nil];
    //        cell.label.text=ary[indexPath.row];
    //        return cell;
    //    }
    //    if (indexPath.section==1)
    //    {
    //        NSArray*ary=[NSArray arrayWithObjects:@"京东支付",@"京东支付0费率", nil];
    //        cell.label.text=ary[indexPath.row];
    //        return cell;
    //    }
    cell.label.text=ary[indexPath.row];
    cell.tupian.image=[UIImage imageNamed:ary[indexPath.row]];
    return cell;
}
//返回按钮
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==0)
    {
        NSLog(@"222");
        YiBaoZhiFuViewController*yB=[[YiBaoZhiFuViewController alloc]init];
        [self.navigationController pushViewController:yB animated:YES];
        
    }
}
-(void)butClick
{
    [self.navigationController popViewControllerAnimated:YES];
}

    // Do any additional setup after loading the view from its nib.


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
